/*
 * @Autor: dingxiaolin
 * @Date: 2021-06-02 16:36:24
 * @LastEditors: dingxiaolin
 * @LastEditTime: 2021-07-18 09:14:53
 */
import { createStorage } from '@/utils/lStorage'
const lStorage = createStorage({ storage: localStorage })

export type settingState = {
    theme: string,
    color: string,
    mode: string,
    sidebar: boolean,
    contentWidth: string,
    fixedHeader: boolean,
    showBread: boolean,
    multiTab: boolean,
    weak: boolean,
    device: string,
    collapsed: boolean
    openAll: boolean
}

export const state: settingState = {
    theme: lStorage.get('theme', 'dark'),
    color: lStorage.get('color', ''),
    mode: lStorage.get('mode', 'sidemenu'),
    contentWidth: lStorage.get('contentWidth', 'Fixed'),
    fixedHeader: lStorage.get('fixedHeader', true),
    showBread: lStorage.get('showBread', true),
    multiTab: lStorage.get('multiTab', false),
    weak: lStorage.get('weak', false),
    openAll: lStorage.get('openAll', false),
    sidebar: true,
    device: 'desktop',
    collapsed: false
}
